﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JWUX.Supermarket.Model;

namespace JWUX.Supermarket.IDAL
{
    public interface IUser
    {
        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="model">需要添加的用户实例</param>
        /// <returns>用户自增生成的ID</returns>
        int Insert(UserInfo model);

        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="model">需要删除的用户实例</param>
        /// <returns>是否删除成功</returns>
        bool Delete(UserInfo model);

        /// <summary>
        /// 更新指定用户
        /// </summary>
        /// <param name="model">需要更新的用户实例</param>
        /// <returns>是否更新成功</returns>
        bool Update(UserInfo model);

        /// <summary>
        /// 根据用户ID获取单个用户
        /// </summary>
        /// <param name="Id">用户ID</param>
        /// <returns></returns>
        UserInfo Get(int Id);

        /// <summary>
        /// 获取所有可用用户列表
        /// </summary>
        /// <returns></returns>
        List<UserInfo> Get();

        /// <summary>
        /// 判断用户是否已经存在
        /// </summary>
        /// <param name="userName">NTID/EmployeeId</param>
        /// <returns></returns>
        bool Exists(string userName);

        /// <summary>
        /// 以NTID形式验证登录
        /// </summary>
        /// <param name="ntid"></param>
        /// <returns></returns>
        UserInfo LoginValidate(string ntid);

        /// <summary>
        /// 验证用户登录
        /// </summary>
        /// <param name="employeeId">登录工号</param>
        /// <param name="passWord">登录密码</param>
        /// <returns></returns>
        UserInfo LoginValidate(string employeeId, string passWord);
    }
}
